﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Share/Index.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        function ajax() {
            var in_s = $.trim($("#seekForm :input[name=in_s]").val());
            var in_e = $.trim($("#seekForm :input[name=in_e]").val());

            var param = { in_s: in_s, in_e: in_e };
            $.post("/report/getBasicReport.html?" + (new Date()).getTime(), param, function (data) {
                data = $.evalJSON(data);
                var sp = [], t9, t10, t11, t12, t13;
                t9 = $.grep(data, function (n, i) { return typeof (n.t9) == "number"; })[0].t9;
                t10 = $.grep(data, function (n, i) { return typeof (n.t10) == "number"; })[0].t10;
                t11 = $.grep(data, function (n, i) { return typeof (n.t11) == "number"; })[0].t11;
                t12 = $.grep(data, function (n, i) { return typeof (n.t12) == "number"; })[0].t12;
                t13 = $.grep(data, function (n, i) { return typeof (n.t13) == "number"; })[0].t13;


                sp.push('<tr><td>新增会员：' + $.grep(data, function (n, i) { return typeof (n.t1) == "number"; })[0].t1 + '人</td></tr>');
                sp.push('<tr><td>退订会员：' + $.grep(data, function (n, i) { return typeof (n.t2) == "number"; })[0].t2 + '人</td></tr>');
                sp.push('<tr><td>借阅人数：' + $.grep(data, function (n, i) { return typeof (n.t3) == "number"; })[0].t3 + '人</td></tr>');
                sp.push('<tr><td>借出书籍：' + $.grep(data, function (n, i) { return typeof (n.t4) == "number"; })[0].t4 + '本</td></tr>');
                sp.push('<tr><td>归还书籍：' + $.grep(data, function (n, i) { return typeof (n.t5) == "number"; })[0].t5 + '本</td></tr>');
                sp.push('<tr><td>入库图书：' + $.grep(data, function (n, i) { return typeof (n.t6) == "number"; })[0].t6 + '种,' + $.grep(data, function (n, i) { return typeof (n.t7) == "number"; })[0].t7 + '本</td></tr>');
                sp.push('<tr><td>入库电子书：' + $.grep(data, function (n, i) { return typeof (n.t8) == "number"; })[0].t8 + '本</td></tr>');
                sp.push('<tr><td>新增卡费：' + t9 + '元</td></tr>');
                sp.push('<tr><td>新增押金：' + t10 + '元</td></tr>');
                sp.push('<tr><td>退还费用：' + t11 + '元</td></tr>');
                sp.push('<tr><td>退还押金：' + t12 + '元</td></tr>');
                sp.push('<tr><td>其他款项：' + t13 + '元</td></tr>');
                sp.push('<tr><td style="height:20px;"></td></tr>');
                sp.push('<tr><td>资金总计：' + (t9 + t10 + t13 - t11 - t12) + '元</td>');
                $("#mainTable tbody[name=mainlist]").html("");
                $("#mainTable tbody[name=mainlist]").append(sp.join(''));
            });
        }
        ajax();
        $("input[name=buttSeek]").click(function () {
            ajax();
        });
    });
</script>
    <table cellspacing="0" id="seekForm">
        <tr>
            <th>
                基础数据统计
            </th>
        </tr>
        <tr>
            <td>
            <input type="text" class="date" size="15" name="in_s" value="<%=System.DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd") %>" />
                至<input type="text" size="15" class="date" name="in_e" value="<%=System.DateTime.Now.ToString("yyyy-MM-dd") %>"  />
                <input type="button" name="buttSeek" value="查询" onclick="" class="btn1" />
            </td>
        </tr>
    </table>
        <table  id="mainTable" cellspacing="0">
        <tbody name="mainlist">
        
        </tbody>
    </table>

</asp:Content>
